﻿/*$(document).ready(function(){
	$.ajax({
		type:"POST",
		url:"news_updateNewsType.action",
		data:{$("#")},
		cache:false,
		dataType:"json",
		contentType:"application/x-www-form-urlencoded",
		beforeSend:function(){
			$("#moblieType").length=0;
		},
		success:function(data){
			$(data).each(function(i,item){
			for(var i=0;i<item.mtypeList.length;i++){
				var op="<option value=\""+item.mtypeList[i].tid+"\">"+item.mtypeList[i].tname+"</option>";
				$("#moblieType").append(op);
			}
				//alert(JSON.stringify(item.mtypeList[i]))
			});
		},
		error:function(xmlHttpRequest, errorText){
			alert(errorText+":"+xmlHttpRequest.readyState);
		},
	});
}*/



function updateType(obj,id,newsType){
	$.ajax({
//		type:"GET",
//		url:"news_updateNewsType.html?news.newsId="+id+"&news.newsType="+newsType+"&+"+new Date(),
//		data:{},
		type:"POST",
		url:"news_updateNewsType.html",
		data:{"news.newsId":id,"news.newsType":newsType,"date":new Date()},
		cache:false,
		dataType:"json",
		contentType:"application/x-www-form-urlencoded; charset=utf-8",
		beforeSend:function(){
			//$("#moblieType").length=0;
		},
		success:function(data){
				var text="[置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;顶]";
				if(newsType=="置顶"){
					obj.name="未置顶";
					text="[取消置顶]";
				}else{
					obj.name="置顶";
				}
				obj.innerHTML=text;	
		
		},
		error:function(xmlHttpRequest, errorText){
			alert("失败");
		}
	});
	
}



